package com.one.util;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @ClassName: RequestReturn
 * @Auther: yph
 * @Date: 2022/1/14 09:50
 * @Description: 统一返回实体类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true) // 流式操作  new RequestReturn().setCode(111).setMessage("成功");
@ApiModel(value = "统一返回实体")
public class RequestReturn<T> {

    /**
     * 状态码
     */
    @ApiModelProperty(value = "状态码")
    private Integer code;

    /**
     * 状态信息
     */
    @ApiModelProperty(value = "状态信息")
    private String message;

    /**
     * 待返回数据
     */
    @ApiModelProperty(value = "待返回数据")
    private T data;
}
